package com.sx.core.dao

import com.sx.core.dao.sql.SqlProvider
import org.apache.ibatis.annotations.*
/**
 * Created by lihao on 2018/12/5.
 */
interface CurdMapper<T> {
    @InsertProvider(type = SqlProvider.class,method = "insertSql")
    int save(@Param("rec")T obj);

    @UpdateProvider(type = SqlProvider.class,method = "updateSql")
    int update(@Param("rec")T obj);

    @DeleteProvider(type = SqlProvider.class,method = "deleteSql")
    int delete(@Param("rec")Class<T> obj, @Param("id") String id);

    @SelectProvider(type = SqlProvider.class,method = "getSql")
    T get(@Param("rec")Class<T> obj, @Param("id") String id);

    @SelectProvider(type = SqlProvider.class,method = "listSql")
    List<T> list(@Param("rec")Class<T> obj);











}
